<template>
  <div class="test-message-box">
    <el-button @click="showConfirm">测试确认框</el-button>
  </div>
</template>

<script setup>
import { ElMessageBox } from 'element-plus'

function showConfirm() {
  ElMessageBox.confirm('这是一个确认对话框', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  })
    .then(() => {
      console.log('用户点击了确定')
    })
    .catch(() => {
      console.log('用户点击了取消')
    })
}
</script>

<style scoped>
.test-message-box {
  padding: 20px;
}
</style>